package com.sinosoft.cpyy.controller.admin;

import com.sinosoft.cpyy.model.vo.scoreVo;
import com.sinosoft.cpyy.service.score.ScoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * 创建时间：2018/三月/27
 *
 * @author 张政[zhang_zheng@sinosoft.com.cn]
 * 类名：ScoreController
 * 描述：分数接口
 */
@Controller
@RequestMapping("/admin")
public class ScoreController {

    private final ScoreService scoreService;

    @Autowired
    public ScoreController(ScoreService scoreService) {
        this.scoreService = scoreService;
    }

    @RequestMapping(value = "/score.html", method = RequestMethod.GET)
    public ModelAndView findUserExamInfo() {
        List<scoreVo> listScore = scoreService.findUserExamInfo();
        System.out.println("---------------------");
        System.out.println(listScore);
        System.out.println("---------------------");
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("listScore", listScore);
        modelAndView.setViewName("_admin/score");
        return modelAndView;
    }

}
